home *** CD-ROM | disk | FTP | other *** search
/ PC Direct 1998 August / PC Direct August 1998.iso / S / powerj / Product / hpp.z / WWINDOW.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-25  |  64.3 KB  |  1,896 lines

  1. /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2.    %     Copyright (C) 1994, by WATCOM International Inc.  All rights    %
  3.    %     reserved.  No part of this software may be reproduced or        %
  4.    %     used in any form or by any means - graphic, electronic or       %
  5.    %     mechanical, including photocopying, recording, taping or        %
  6.    %     information storage and retrieval systems - except with the     %
  7.    %     written permission of WATCOM International Inc.                 %
  8.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. */
  10.  
  11. /*************************************************************************
  12.  *
  13.  * WWindow -- Base Window class
  14.  *
  15.  *
  16.  *   Events:
  17.  *
  18.  *       Activate --
  19.  *
  20.  *       ActivateApplication --
  21.  *
  22.  *       AfterProcessing --
  23.  *
  24.  *       BeforeProcessing --
  25.  *
  26.  *       CalculateSize --
  27.  *
  28.  *       CharacterPress --
  29.  *
  30.  *       Close --
  31.  *
  32.  *       Command --
  33.  *
  34.  *       CompareItem --
  35.  *
  36.  *       ContextHelp --
  37.  *
  38.  *       ContextMenu --
  39.  *
  40.  *       ControlColor --
  41.  *
  42.  *       Create --
  43.  *
  44.  *       Deactivate --
  45.  *
  46.  *       DeleteItem --
  47.  *
  48.  *       Destroy --
  49.  *
  50.  *       DeviceChange --
  51.  *
  52.  *       DisplayChange --
  53.  *
  54.  *       DockingChange --
  55.  *
  56.  *       DragContinue -- When a drag-and-drop operation is about to continue
  57.  *
  58.  *       DragDrop -- When a drag-and-drop operation has been accepted
  59.  *
  60.  *       DragEnd -- When a drag-and-drop operation has ended
  61.  *
  62.  *       DragEnter -- When a drag-and-drop operation has been entered
  63.  *
  64.  *       DragFeedback -- When a drag-and-drop operation requests feedback
  65.  *
  66.  *       DragFill --
  67.  *
  68.  *       DragLeave -- When a drag-and-drop operation is about to end
  69.  *
  70.  *       DragOver -- When a window is currently a candidate for a
  71.  *                   drag-and-drop operation
  72.  *
  73.  *       DragScroll -- When a drag-and-drop operation is about to scroll
  74.  *
  75.  *       DragStart -- When a drag-and-drop operation has started
  76.  *
  77.  *       DrawItem -- When an item is to be drawn
  78.  *
  79.  *       DropFile -- When a window has been the recipient of a file
  80.  *                   drag-and-drop operation
  81.  *
  82.  *       EndSession --
  83.  *
  84.  *       EnterIdle -- When a child modal dialog box or menu enters an idle
  85.  *                    state
  86.  *
  87.  *       EnterSizeMove --
  88.  *
  89.  *       EraseBackground -- When the background of the window needs painting
  90.  *
  91.  *       ExitSizeMove --
  92.  *
  93.  *       GetCursor --
  94.  *
  95.  *       GotFocus -- When a window has received the focus
  96.  *
  97.  *       Help -- When help is requested (i.e. F1 is pressed)
  98.  *
  99.  *       Hide --
  100.  *
  101.  *       HitTest --
  102.  *
  103.  *       InitMenu --
  104.  *
  105.  *       InitPopupMenu --
  106.  *
  107.  *       InputLangChange --
  108.  *
  109.  *       InputLangChangeRequest --
  110.  *
  111.  *       KeyDown --
  112.  *
  113.  *       KeyUp --
  114.  *
  115.  *       LeftButtonDown -- When the left mouse button has been depressed
  116.  *
  117.  *       LeftButtonDouble -- When the left mouse button double clicked
  118.  *
  119.  *       LeftButtonUp -- When the left mouse button has been released
  120.  *
  121.  *       LostFocus -- When a window has lost the focus
  122.  *
  123.  *       Maximize --
  124.  *
  125.  *       MeasureItem --
  126.  *
  127.  *       MenuSelect --
  128.  *
  129.  *       MiddleButtonDown -- When the middle mouse button has been depressed
  130.  *
  131.  *       MiddleButtonDouble -- When the middle mouse button double clicked
  132.  *
  133.  *       MiddleButtonUp -- When the middle mouse button has been released
  134.  *
  135.  *       Minimize --
  136.  *
  137.  *       MouseMove -- When the mouse moves
  138.  *
  139.  *       Move -- When the window has moved
  140.  *
  141.  *       NeedToolTipText --
  142.  *
  143.  *       NonClientPaint --
  144.  *
  145.  *       Notify --
  146.  *
  147.  *       Paint --
  148.  *
  149.  *       PaletteChanged --
  150.  *
  151.  *       PositionChanged --
  152.  *
  153.  *       PositionChanging --
  154.  *
  155.  *       PowerBroadcast --
  156.  *
  157.  *       Print --
  158.  *
  159.  *       PrintClient --
  160.  *
  161.  *       PrivateMessage --
  162.  *
  163.  *       QueryEndSession --
  164.  *
  165.  *       QueryNewPalette --
  166.  *
  167.  *       Resize --
  168.  *
  169.  *       RightButtonDown -- When the right mouse button has been depressed
  170.  *
  171.  *       RightButtonDouble -- When the right mouse button double clicked
  172.  *
  173.  *       RightButtonUp -- When the right mouse button has been released
  174.  *
  175.  *       Scroll --
  176.  *
  177.  *       SettingChange --
  178.  *
  179.  *       Show --
  180.  *
  181.  *       SizeChanging --
  182.  *
  183.  *       SysColorChange --
  184.  *
  185.  *       SysDeadChar --
  186.  *
  187.  *       SystemCommand --
  188.  *
  189.  *       SystemKeyDown --
  190.  *
  191.  *       User -- When a user event is signalled
  192.  *
  193.  *       UserChanged --
  194.  *
  195.  *************************************************************************/
  196.  
  197. #ifndef _WWINDOW_HPP_INCLUDED
  198. #define _WWINDOW_HPP_INCLUDED
  199.  
  200. #ifndef _WNO_PRAGMA_PUSH
  201. #pragma pack(push,8);
  202. #pragma enum int;
  203. #endif
  204.  
  205. #include "wdef.hpp"
  206. #include "wdrag.hpp"
  207. #include "winputcx.hpp"                 // IMM input context
  208.  
  209. #ifndef _WCALLBACK_HPP_INCLUDED
  210. #  include "wcallbck.hpp"
  211. #endif
  212. #ifndef _WKEYDEFS_HPP_INCLUDED
  213. #  include "wkeydefs.hpp"
  214. #endif
  215. #ifndef _WOBJECT_HPP_INCLUDED
  216. #  include "wobject.hpp"
  217. #endif
  218. #ifndef _WRECT_HPP_INCLUDED
  219. #  include "wrect.hpp"
  220. #endif
  221. #ifndef _WSTRING_HPP_INCLUDED
  222. #  include "wstring.hpp"
  223. #endif
  224. #ifndef _WCOLOR_HPP_INCLUDED
  225. #  include "wcolor.hpp"
  226. #endif
  227. #ifndef _WBRUSH_HPP_INCLUDED
  228. #  include "wbrush.hpp"
  229. #endif
  230. #ifndef _WFONT_HPP_INCLUDED
  231. #  include "wfont.hpp"
  232. #endif
  233. #ifndef _WEVENTD_HPP_INCLUDED
  234. #  include "weventd.hpp"
  235. #endif
  236. #ifndef _WMESSAGE_HPP_INCLUDED
  237. #  include "wmessage.hpp"
  238. #endif
  239. #ifndef _WREGION_HPP_INCLUDED
  240. #  include "wregion.hpp"
  241. #endif
  242. #ifndef _WSEMAPHORE_HPP_INCLUDED
  243. #  include "wsemaphr.hpp"
  244. #endif
  245. #ifndef _WVECTOR_HPP_INCLUDED
  246. #  include "wvector.hpp"
  247. #endif
  248. #ifndef _WDRAW_HPP_INCLUDED
  249. #  include "wdraw.hpp"
  250. #endif
  251. #ifndef _WKEYBLAY_HPP_INCLUDED
  252. #  include "wkeyblay.hpp"
  253. #endif
  254.  
  255. #ifndef _WIN16
  256. #undef PostMessage
  257. #undef SendMessage
  258. #if defined( _UNICODE )
  259.     #define PostMessage                 PostMessageW
  260.     #define SendMessage                 SendMessageW
  261. #else
  262.     #define PostMessage                 PostMessageA
  263.     #define SendMessage                 SendMessageA
  264. #endif
  265. #endif
  266.  
  267. class WPopupMenu;
  268. class WMenu;
  269. class WCursor;
  270. class WResourceID;
  271. class WColor;
  272. class WFont;
  273. class WDisplayCanvas;
  274. class WCanvas;
  275. class WToolTip;
  276. class WForm;
  277. class WControl;
  278. class WWindow;
  279. class WHotKey;
  280. class WDockFloatingForm;
  281.  
  282. enum WDockPosition {
  283.     WDockNotDocked = 0,
  284.     WDockFloating,
  285.     WDockTop,
  286.     WDockBottom,
  287.     WDockLeft,
  288.     WDockRight
  289. };
  290.  
  291. enum WHitTestCode {
  292.     WHTError = -2,
  293.     WHTTransparent = -1,
  294.     WHTNowhere = 0,
  295.     WHTClient = 1,
  296.     WHTCaption = 2,
  297.     WHTSysMenu = 3,
  298.     WHTGrowBox = 4,
  299.     WHTSize = WHTGrowBox,
  300.     WHTMenu = 5,
  301.     WHTHScroll = 6,
  302.     WHTVScroll = 7,
  303.     WHTMinButton = 8,
  304.     WHTMaxButton = 9,
  305.     WHTLeft = 10,
  306.     WHTRight = 11,
  307.     WHTTop = 12,
  308.     WHTTopLeft = 13,
  309.     WHTTopRight = 14,
  310.     WHTBottom = 15,
  311.     WHTBottomLeft = 16,
  312.     WHTBottomRight = 17,
  313.     WHTBorder = 18,
  314.     WHTReduce = WHTMinButton,
  315.     WHTZoom = WHTMaxButton,
  316.     WHTSizeFirst = WHTLeft,
  317.     WHTSizeLast = WHTBottomRight,
  318.     WHTObject = 19,
  319.     WHTClose = 20,
  320.     WHTHelp = 21
  321. };
  322.  
  323. enum WDragMode {
  324.     WNoDrag                     = 0,
  325.     WManualDrag                 = 1,
  326.     WAutomaticLeftDrag          = 2,
  327.     WAutomaticRightDrag         = 3,
  328. };
  329.  
  330. typedef WUShort WMouseMessage;
  331.  
  332. /**************************************************
  333. ******************************************************
  334. ***************************************************/
  335.  
  336. enum WDeviceType {
  337.     WDeviceTypeOEM      = 0x00000000,
  338.     WDeviceTypeDevNode  = 0x00000001,
  339.     WDeviceTypeVolume   = 0x00000002,
  340.     WDeviceTypePort     = 0x00000003,
  341.     WDeviceTypeNet      = 0x00000004,
  342.  
  343.     WDeviceTypeNULL     = 0xffffffff
  344. };
  345.  
  346. enum WEventType {
  347.     WEventTypeAppyBegin         = 0x0000,
  348.     WEventTypeAppyEnd           = 0x0001,
  349.     WEventTypeDevNodesChanged   = 0x0007,
  350.     WEventTypeQueryChangeConfig = 0x0017,
  351.     WEventTypeConfigChanged     = 0x0018,
  352.     WEventTypeConfigChangeCanceled = 0x0019,
  353.     WEventTypeMonitorChange     = 0x001b,
  354.     WEventTypeShellLoggedOn     = 0x0020,
  355.  
  356.     WEventTypeConfigMGAPI32     = 0x0022,
  357.     
  358.     WEventTypeVolLockQueryLock  = 0x8041,
  359.     WEventTypeVolLockLockTaken  = 0x8042,
  360.     WEventTypeVolLockLockFailed = 0x8043,
  361.     WEventTypeVolLockQueryUnlock= 0x8044,
  362.     WEventTypeVolLockLockReleased = 0x0045,
  363.     WEventTypeVolLockUnlockFailed = 0x8046,
  364.     
  365.     WEventTypeNoDiskSpace       = 0x0047,
  366.     WEventTypeConfigGMGPrivate  = 0x7fff,
  367.  
  368.     WEventTypeDevArrival        = 0x8000,
  369.     WEventTypeDevQueryMode      = 0x8001,
  370.     WEventTypeDevQueryModeFailed= 0x8002,
  371.     WEventTypeDevRemovePending  = 0x8003,
  372.     WEventTypeDevRemoveComplete = 0x8004,
  373.     WEventTypeDevTypeSpecific   = 0x8005,
  374.  
  375.     WEventTypeVPowerDAPI        = 0x8100,
  376.     WEventTypeUserDefined       = 0xffff
  377. };
  378.  
  379. struct WWindowPlacement {
  380.     WShowStyle          showStyle;
  381.     WPoint              minimizedPosition;
  382.     WPoint              maximizedPosition;
  383.     WRect               normalPosition;
  384. };
  385.  
  386. struct WDeviceChangeEventData : public WEventData {
  387.     WEventType          eventType;
  388.     WDeviceType         deviceType;
  389. };
  390.  
  391. enum WVolumeLockPermission {
  392.     WVolumeLockPermAllowWrites  = 0x01,
  393.     WVolumeLockPermFailWrites   = 0x00,
  394.     WVolumeLockPermFailMemMapping = 0x02,
  395.     WVolumeLockPermAllowMemMapping= 0x00,
  396.     WVolumeLockPermUserMask     = 0x03,
  397.     WVolumeLockPermLockForFormat= 0x04  
  398. };
  399.  
  400. enum WVolumeLockFlags {
  401.     WVolumeLockFlagsLogicalLock = 0x00,
  402.     WVolumeLockFlagsPhysicalLock= 0x01  
  403. };    
  404.  
  405. struct WVolumeLockDeviceChangeEventData : public WDeviceChangeEventData {
  406.     WDWord              owner;
  407.     WByte               permision;
  408.     WByte               lockType;
  409.     WByte               drive;
  410.     WByte               flags;      
  411. };
  412.  
  413. struct WOEMDeviceChangeEventData : public WDeviceChangeEventData {
  414.     WDWord      identifier;
  415.     WDWord      suppFunc;   
  416. };
  417.  
  418.  
  419. struct WDevNodeDeviceChangeEventData : public WDeviceChangeEventData {
  420.     WDWord      devNode;
  421. };
  422.  
  423. enum WVolumeDeviceChangeFlags {
  424.     WVolumeDeviceChangeMedia    = 0x0001,
  425.     WVolumeDeviceChangeNet      = 0x0002
  426. };
  427.  
  428. struct WVolumeDeviceChangeEventData : public WDeviceChangeEventData {
  429.     WDWord              unitMask;
  430.     WUShort             flags;
  431. };
  432.  
  433. struct WPortDeviceChangeEventData : public WDeviceChangeEventData {
  434.     WString                     name;
  435. };
  436.  
  437. enum WNetDeviceChangeFlags {
  438.     WNetDeviceChangeResource    = 0x00000001,
  439.     WNetDeviceChangeXPort       = 0x00000002,
  440.     WNetDeviceChangeSlowNet     = 0x00000004
  441. };    
  442.  
  443. struct WNetDeviceChangeEventData : public WDeviceChangeEventData {
  444.     WDWord              resource;
  445.     WDWord              flags;
  446. };
  447.  
  448. struct WUserDefinedDeviceChangeEventData : public WDeviceChangeEventData {
  449.     WString             name;
  450. };
  451.  
  452. struct WMGAPI32DeviceChangeEventData : public WDeviceChangeEventData {
  453.     void*               userDefined;
  454. };
  455.  
  456. struct WVPowerDAPIDeviceChangeEventData : public WDeviceChangeEventData {
  457.     void*               power;
  458. };
  459.  
  460. struct WNoDiskSpaceDeviceChangeEventData : public WDeviceChangeEventData {
  461.     void*               driveNumber;
  462. };
  463.  
  464. struct WDisplayChangeEventData : public WEventData {
  465.     WUShort BitPerPixel;
  466.     WUShort xResolution;
  467.     WUShort yResolution;
  468. };
  469.  
  470. struct WDockingChangeEventData : public WEventData {
  471.     WDockPosition       oldPosition;
  472.     WDockPosition       newPosition;
  473. };
  474.  
  475. // WShowWindowFlag equivalents for the SW_* flags in winuser.h
  476.  
  477. enum WShowWindowFlag {
  478.     WSWFHide = 0,
  479.     WSWFShowNormal,
  480.     WSWFShowMinimized,
  481.     WSWFShowMaximized,
  482.     WSWFShowNoActivate,
  483.     WSWFShow,
  484.     WSWFMinimize,
  485.     WSWFShowMinNoActivate,
  486.     WSWFShowNA,
  487.     WSWFRestore,
  488.     WSWFShowDefault
  489. };
  490.  
  491. enum WPowerBroadcastPowerEvent {
  492.     WPowerBroadcastQuerySuspend         = 0x0000,
  493.     WPowerBroadcastQueryStandBy         = 0x0001,
  494.     WPowerBroadcastSuspendFailed        = 0x0002,
  495.     WPowerBroadcastStandByFailed        = 0x0003,
  496.     WPowerBroadcastSuspend              = 0x0004,
  497.     WPowerBroadcastStandBy              = 0x0005,
  498.     WPowerBroadcastResumeCritical       = 0x0006,
  499.     WPowerBroadcastResumeSuspend        = 0x0007,
  500.     WPowerBroadcastResumeStandBy        = 0x0008,
  501.     WPowerBroadcastBatteryLow           = 0x0009,
  502.     WPowerBroadcastPowerStatusChange    = 0x000a,
  503.     WPowerBroadcastOEMEvent             = 0x000b
  504. };
  505.  
  506. enum WPowerBroadcastPowerFlag {
  507.     WPowerBroadcastResumeFromFailure    = 0x00000001
  508. };
  509.  
  510. struct WPowerBroadcastEventData : public WEventData {
  511.     WDWord  powerEvent;
  512.     WDWord  powerData;
  513. };
  514.  
  515. enum WSettingChangeAction {
  516.     WSettingChangeGetBeep               =  1,
  517.     WSettingChangeSetBeep               =  2,
  518.     WSettingChangeGetMouse              =  3,
  519.     WSettingChangeSetMouse              =  4,
  520.     WSettingChangeGetBorder             =  5,
  521.     WSettingChangeSetBorder             =  6,
  522.     WSettingChangeGetKeyboardSpeed      = 10,
  523.     WSettingChangeSetKeyboardSpeed      = 11,
  524.     WSettingChangeLangDriver            = 12,
  525.     WSettingChangeIconHorizontalSpacing = 13,
  526.     WSettingChangeGetScreenSaveTimeOut  = 14,
  527.     WSettingChangeSetScreenSaveTimeOut  = 15,
  528.     WSettingChangeGetScreenSaveActive   = 16,
  529.     WSettingChangeSetScreenSaveActive   = 17,
  530.     WSettingChangeGetGridGranularity    = 18,
  531.     WSettingChangeSetGridGranularity    = 19,
  532.     WSettingChangeSetDeskWallPaper      = 20,
  533.     WSettingChangeSetDeskPattern        = 21,
  534.     WSettingChangeGetKeyboardDelay      = 22,
  535.     WSettingChangeSetKeyboardDelay      = 23,
  536.     WSettingChangeIconVerticalSpacing   = 24,
  537.     WSettingChangeGetIconTitleWrap      = 25,
  538.     WSettingChangeSetIconTitleWrap      = 26,
  539.     WSettingChangeGetMenuDropAlignment  = 27,
  540.     WSettingChangeSetMenuDropAlignment  = 28,
  541.     WSettingChangeSetDoubleClkWidth     = 29,
  542.     WSettingChangeSetDoubleClkHeight    = 30,
  543.     WSettingChangeGetIconTitleLogFont   = 31,
  544.     WSettingChangeSetDoubleClickTime    = 32,
  545.     WSettingChangeSetMouseButtonSwap    = 33,
  546.     WSettingChangeSetIconTitleLogFont   = 34,
  547.     WSettingChangeGetFastTaskSwitch     = 35,
  548.     WSettingChangeSetFastTaskSwitch     = 36,
  549.     WSettingChangeSetDragFullWindows    = 37,
  550.     WSettingChangeGetDragFullWindows    = 38,
  551.     WSettingChangeGetNonClientMetrics   = 41,
  552.     WSettingChangeSetNonClientMetrics   = 42,
  553.     WSettingChangeGetMinimizedMetrics   = 43,
  554.     WSettingChangeSetMinimizedMetrics   = 44,
  555.     WSettingChangeGetIconMetrics        = 45,
  556.     WSettingChangeSetIconMetrics        = 46,
  557.     WSettingChangeSetWorkArea           = 47,
  558.     WSettingChangeGetWorkArea           = 48,
  559.     WSettingChangeSetPenWindows         = 49,
  560.     WSettingChangeGetHighContrast       = 66,
  561.     WSettingChangeSetHighContrast       = 67,
  562.     WSettingChangeGetKeyboardPref       = 68,
  563.     WSettingChangeSetKeyboardPref       = 69,
  564.     WSettingChangeGetScreenReader       = 70,
  565.     WSettingChangeSetScreenReader       = 71,
  566.     WSettingChangeGetAnimation          = 72,
  567.     WSettingChangeSetAnimation          = 73,
  568.     WSettingChangeGetFontSmoothing      = 74,
  569.     WSettingChangeSetFontSmoothing      = 75,
  570.     WSettingChangeSetDragWidth          = 76,
  571.     WSettingChangeSetDragHeight         = 77,
  572.     WSettingChangeSetHandHeld           = 78,
  573.     WSettingChangeGetLowPowerTimeOut    = 79,
  574.     WSettingChangeGetPowerOffTimeOut    = 80,
  575.     WSettingChangeSetLowPowerTimeOut    = 81,
  576.     WSettingChangeSetPowerOffTimeOut    = 82,
  577.     WSettingChangeGetLowPowerActive     = 83,
  578.     WSettingChangeGetPowerOffActive     = 84,
  579.     WSettingChangeSetLowPowerActive     = 85,
  580.     WSettingChangeSetPowerOffActive     = 86,
  581.     WSettingChangeSetCursors            = 87,
  582.     WSettingChangeSetIcons              = 88,
  583.     WSettingChangeGetDefaultInputLang   = 89,
  584.     WSettingChangeSetDefaultInputLang   = 90,
  585.     WSettingChangeSetLangToggle         = 91,
  586.     WSettingChangeGetWindowsExtension   = 92,
  587.     WSettingChangeSetMouseTrails        = 93,
  588.     WSettingChangeGetMouseTrails        = 94,
  589.     WSettingChangeScreenSaverRunning    = 97,
  590.     WSettingChangeGetFilterKeys         = 50,
  591.     WSettingChangeSetFilterKeys         = 51,
  592.     WSettingChangeGetToggleKeys         = 52,
  593.     WSettingChangeSetToggleKeys         = 53,
  594.     WSettingChangeGetMouseKeys          = 54,
  595.     WSettingChangeSetMouseKeys          = 55,
  596.     WSettingChangeGetShowSounds         = 56,
  597.     WSettingChangeSetShowSounds         = 57,
  598.     WSettingChangeGetStickyKeys         = 58,
  599.     WSettingChangeSetStickyKeys         = 59,
  600.     WSettingChangeGetAccessTimeOut      = 60,
  601.     WSettingChangeSetAccessTimeOut      = 61,
  602.     WSettingChangeGetSerialKeys         = 62,
  603.     WSettingChangeSetSerialKeys         = 63,
  604.     WSettingChangeGetSoundSentry        = 64,
  605.     WSettingChangeSetSoundSentry        = 65
  606. };
  607.  
  608. enum WSettingChangeFlags {
  609.     WSettingChangeUpdateIniFile         = 0x0001,
  610.     WSettingChangeSendWinIniChange      = 0x0002,
  611.     WSettingChangeSendChange            = 0x0002, // == WSettingChangeSendWinIniChange
  612. };
  613.  
  614. struct WSettingChangeEventData : public WEventData {
  615.     WDWord   flags;
  616.     WString  metricsName;
  617. };
  618.  
  619. struct WLangChangeEventData : public WEventData {
  620.     WDWord              charSet;
  621.     WKeyboardHandle     hkl;            
  622. };
  623.  
  624. struct WLangChangeRequestEventData : public WEventData {
  625.     WBool               sysCharSet;
  626.     WKeyboardHandle     hkl;            
  627. };
  628.  
  629. struct WScrollBarEventData;
  630.  
  631. struct WSysDeadCharEventData : public WEventData {
  632.     WUnicodeChar        charCode;
  633.     WULong              keyData;
  634. };
  635.  
  636. /**************************************************
  637. ******************************************************
  638. ***************************************************/
  639.  
  640. struct WActivateEventData : public WEventData {
  641.     WWindow *           window;
  642.     WWindowHandle       handle;
  643.     WBool               causedByClick;
  644. };
  645.  
  646. struct WActivateApplicationEventData : public WEventData {
  647.     WDWord              threadID;
  648. };
  649.  
  650. struct WCalculateSizeEventData : public WEventData {
  651.     WRect               size;
  652.     WBool               adjust;
  653. };
  654.  
  655. struct WCharacterPressEventData : public WEventData {
  656.     WKeyState           state;
  657.     WChar               key;
  658.     WBool               prevDown;
  659.     WBool               keyDown;
  660.     WUInt               scanCode;
  661.     WUInt               repeatCount;
  662. };
  663.  
  664. typedef WEventData WClickEventData;
  665.  
  666. struct WContextMenuEventData : public WEventData {
  667.     WWindow *           sourceWindow;
  668.     WWindowHandle       sourceHandle;
  669.     WPoint              clickedAt;
  670. };
  671.  
  672. struct WEndSessionEventData : public WEventData {
  673.     WBool               endSession;
  674.     WBool               logoff;
  675. };
  676.  
  677. struct WEnterIdleEventData : public WEventData {
  678.     WBool               isDialog;
  679.     WWindow *           window;
  680.     WWindowHandle       handle;
  681. };
  682.  
  683. struct WFocusEventData : public WEventData {
  684.     WWindow *           other;
  685.     WWindowHandle       handle;
  686. };
  687.  
  688. struct WGetCursorEventData : public WEventData {
  689.     WHitTestCode        hitTestCode;
  690.     WEventID            mouseEvent;
  691. };
  692.  
  693. struct WHelpEventData : public WEventData {
  694.     WULong              helpID;
  695.     WULong              objectID;
  696.     WULong              handle;
  697.     WBool               menuHelp;
  698. };
  699.  
  700. struct WHitTestEventData : public WEventData {
  701.     WPoint              newPosition;
  702.     WHitTestCode        hitTestCode;
  703. };
  704.  
  705. struct WKeyPressEventData : public WEventData {
  706.     WKeyState           state;
  707.     WKeyPressCode       key;
  708.     WBool               prevDown;
  709.     WBool               keyDown;
  710.     WUInt               scanCode;
  711.     WUInt               repeatCount;
  712. };
  713.  
  714. struct WMessageEventData : public WEventData, public WMessage {
  715. };
  716.  
  717. struct WMouseEventData : public WEventData {
  718.     WPoint              newPosition;
  719.     WMouseFlags         mouseFlags;
  720. };
  721.  
  722. struct WMoveEventData : public WEventData {
  723.     WPoint              newPosition;
  724. };
  725.  
  726. struct WPaintEventData : public WEventData {
  727.     WDisplayCanvas *    canvas;
  728. };
  729.  
  730. struct WPaletteChangedEventData : public WEventData {
  731.     WWindow *           window;
  732.     WWindowHandle       handle;
  733. };
  734.  
  735. struct WQueryEndSessionEventData : public WEventData {
  736.     WUInt               source;
  737.     WBool               logoff;
  738. };
  739.  
  740. struct WResizeEventData : public WEventData {
  741.     WRect               newPosition;
  742.     WRect               oldPosition;
  743.     WBool               minimizing;
  744.     WBool               maximizing;
  745. };
  746.  
  747. struct WToolTipTextEventData : public WEventData {
  748.     WWindow *           source;
  749.     WULong              id;
  750.     WString             string;
  751. };
  752.  
  753. struct WUserEventData : public WEventData {
  754.     WULong              data;
  755. };
  756.  
  757. // Flags for print events
  758.  
  759. #define WPEDF_CHECKVISIBLE 0x01L
  760. #define WPEDF_NONCLIENT    0x02L
  761. #define WPEDF_CLIENT       0x04L
  762. #define WPEDF_ERASEBKGND   0x08L
  763. #define WPEDF_CHILDREN     0x10L
  764. #define WPEDF_OWNED        0x20L
  765.  
  766. struct WPrintEventData : public WEventData {
  767.     WCanvas *canvas;
  768.     WULong   flags;
  769. };
  770.  
  771. typedef WPrintEventData WPrintClientEventData;
  772.  
  773. struct WHotKeyInfo {
  774.     WKeyState           state;
  775.     WKeyPressCode       code;
  776. };
  777.  
  778. typedef WULong                  WDialogCode;
  779.  
  780. #define WDefaultSize            (0x80000000)
  781.  
  782. #define WDLGCodeWantArrows      (0x0001)
  783. #define WDLGCodeWantTab         (0x0002)
  784. #define WDLGCodeWantAllKeys     (0x0004)
  785. #define WDLGCodeWantMessage     (0x0004)
  786. #define WDLGCodeHasSetSel       (0x0008)
  787. #define WDLGCodeDefPushButton   (0x0010)
  788. #define WDLGCodeUnDefPushButton (0x0020)
  789. #define WDLGCodeRadioButton     (0x0040)
  790. #define WDLGCodeWantChars       (0x0080)
  791. #define WDLGCodeStatic          (0x0100)
  792. #define WDLGCodeButton          (0x2000)
  793.  
  794. //
  795. // Window styles
  796. //
  797.  
  798. #define WSDefault          ((WStyle)0x10CF0000L) // WS_OVERLAPPEDWINDOW|WS_VISIBLE
  799.  
  800. #define WSVisible          ((WStyle)0x10000000L) // WS_VISIBLE
  801. #define WSDisabled         ((WStyle)0x08000000L) // WS_DISABLED
  802. #define WSCaption          ((WStyle)0x00C00000L) // WS_CAPTION
  803. #define WSClipChildren     ((WStyle)0x02000000L) // WS_CLIPCHILDREN
  804. #define WSClipSiblings     ((WStyle)0x04000000L) // WS_CLIPSIBLINGS
  805. #define WSMinimize         ((WStyle)0x20000000L) // WS_MINIMIZE
  806. #define WSMaximize         ((WStyle)0x01000000L) // WS_MAXIMIZE
  807. #define WSHScroll          ((WStyle)0x00100000L) // WS_HSCROLL
  808. #define WSVScroll          ((WStyle)0x00200000L) // WS_VSCROLL
  809. #define WSSizeable         ((WStyle)0x00040000L) // WS_THICKFRAME
  810. #define WSBorder           ((WStyle)0x00800000L) // WS_BORDER
  811. #define WSDlgBorder        ((WStyle)0x00400000L) // WS_DLGFRAME
  812. #define WSDlgFrame         ((WStyle)0x00400000L) // WS_DLGFRAME
  813. #define WSSysMenu          ((WStyle)0x00080000L) // WS_SYSMENU
  814. #define WSSystemMenu       ((WStyle)0x00080000L) // WS_SYSMENU
  815. #define WSOverlapped       ((WStyle)0x00000000L) // WS_OVERLAPPED
  816. #define WSPopup            ((WStyle)0x80000000L) // WS_POPUP
  817. #define WSChild            ((WStyle)0x40000000L) // WS_CHILD
  818. #define WSMinimizeBox      ((WStyle)0x00020000L) // WS_MINIMIZEBOX
  819. #define WSMaximizeBox      ((WStyle)0x00010000L) // WS_MAXIMIZEBOX
  820. #define WSGroup            ((WStyle)0x00020000L) // WS_GROUP
  821. #define WSTabStop          ((WStyle)0x00010000L) // WS_TABSTOP
  822. #define WSResizeBorder     ((WStyle)0x00040000L) // WS_THICKFRAME
  823.  
  824. #define WSExAcceptDropFile ((WStyle)0x00000010L) // WS_EX_ACCEPTFILES
  825. #define WSExAcceptFiles    ((WStyle)0x00000010L) // WS_EX_ACCEPTFILES
  826. #define WSExDlgModalFrame  ((WStyle)0x00000001L) // WS_EX_DLGMODALFRAME
  827. #define WSExNoParentNotify ((WStyle)0x00000004L) // WS_EX_NOPARENTNOTIFY
  828. #define WSExTopmost        ((WStyle)0x00000008L) // WS_EX_TOPMOST
  829. #define WSExTransparent    ((WStyle)0x00000020L) // WS_EX_TRANSPARENT
  830. #define WSExMDIChild       ((WStyle)0x00000040L) // WS_EX_MDICHILD
  831. #define WSExToolWindow     ((WStyle)0x00000080L) // WS_EX_TOOLWINDOW
  832. #define WSExWindowEdge     ((WStyle)0x00000100L) // WS_EX_WINDOWEDGE
  833. #define WSExClientEdge     ((WStyle)0x00000200L) // WS_EX_CLIENTEDGE
  834. #define WSExContextHelp    ((WStyle)0x00000400L) // WS_EX_CONTEXTHELP
  835. #define WSExRight          ((WStyle)0x00001000L) // WS_EX_RIGHT
  836. #define WSExLeft           ((WStyle)0x00000000L) // WS_EX_LEFT
  837. #define WSExLTRReading     ((WStyle)0x00000000L) // WS_EX_LTRREADING
  838. #define WSExRTLReading     ((WStyle)0x00002000L) // WS_EX_RTLREADING
  839. #define WSExLeftScrollbar  ((WStyle)0x00004000L) // WS_EX_LEFTSCROLLBAR
  840. #define WSExRightScrollbar ((WStyle)0x00000000L) // WS_EX_RIGHTSCROLLBAR
  841. #define WSExControlParent  ((WStyle)0x00010000L) // WS_EX_CONTROLPARENT
  842. #define WSExStaticEdge     ((WStyle)0x00020000L) // WS_EX_STATICEDGE
  843. #define WSExAppWindow      ((WStyle)0x00040000L) // WS_EX_APPWINDOW
  844.  
  845. class WCMCLASS WWindow : public WEventGenerator {
  846.     WDeclareSubclass( WWindow, WEventGenerator );
  847.  
  848.     public:
  849.  
  850.         /**************************************************************
  851.          * Constructors and destructors
  852.          **************************************************************/
  853.     
  854.         WWindow();
  855.         WWindow( WWindow *parent, WWindowHandle hdl=NULLHWND );
  856.         WWindow( WWindow *parent, WUInt id, WWindowHandle hdl=NULLHWND );
  857.     
  858.         ~WWindow();
  859.  
  860.         /**************************************************************
  861.          * Properties
  862.          **************************************************************/
  863.  
  864.         // AcceptDropFile
  865.  
  866.         virtual WBool GetAcceptDropFile() const;
  867.         virtual WBool SetAcceptDropFile( WBool acceptDropFile );
  868.  
  869.         // AlwaysOnTop
  870.  
  871.         WBool GetAlwaysOnTop() const;
  872.         WBool SetAlwaysOnTop( WBool alwaysOnTop );
  873.  
  874.         // BackColor
  875.  
  876.         virtual WColor GetBackColor( WBool getResultingColor=TRUE ) const;
  877.         virtual WBool SetBackColor( const WColor & backColor );
  878.  
  879.         // Capture
  880.  
  881.         WBool GetCapture() const;
  882.         WBool SetCapture( WBool capture=TRUE );
  883.  
  884.         // ClientRectangle
  885.  
  886.         WRect GetClientRectangle( WBool absolute=FALSE ) const;
  887.  
  888.         // DefaultStyle
  889.  
  890.         virtual WStyle GetDefaultStyle() const;
  891.  
  892.         // DefaultExtendedStyle
  893.  
  894.         virtual WStyle GetDefaultExtendedStyle() const;
  895.  
  896.         // Dockable
  897.  
  898.         WBool GetDockable() const;
  899.         WBool SetDockable( WBool dockable );
  900.  
  901.         // DockableAtPosition
  902.  
  903.         WBool GetDockableAtPosition( WDockPosition pos ) const;
  904.         WBool SetDockableAtPosition( WBool dockable, WDockPosition pos );
  905.  
  906.         // DockedFrame
  907.  
  908.         WDockFloatingForm *GetDockedFrame() const;
  909.         WBool              SetDockedFrame( WDockFloatingForm * frame );
  910.  
  911.         // DockedIndex
  912.  
  913.         WBool SetDockedIndex( WInt index );
  914.         WInt  GetDockedIndex() const;
  915.  
  916.         // DockedMinimumSize
  917.  
  918.         virtual WSize GetDockedMinimumSize() const;
  919.  
  920.         // DockedOffset
  921.  
  922.         WInt  GetDockedOffset() const;
  923.         WBool SetDockedOffset( WInt offset );
  924.  
  925.         // DockedParent
  926.  
  927.         virtual WForm *GetDockedParent() const;
  928.         virtual WBool  SetDockedParent( WForm * dockedParent );
  929.  
  930.         // DockedPosition
  931.  
  932.         virtual WDockPosition GetDockedPosition();
  933.         virtual void SetDockedPosition( WDockPosition pos, WInt index=0,
  934.                                         WBool insert=FALSE,
  935.                                         WWindow * sibling=NULL,
  936.                                         WBool insertBeforeSibling=TRUE,
  937.                                         WBool callEventHandler=TRUE );
  938.  
  939.         // DockDragging
  940.  
  941.         WBool SetDockDragging( WBool dockDragging );
  942.         WBool GetDockDragging() const;
  943.  
  944.         // DockDragStarting
  945.  
  946.         WBool SetDockDragStarting( WBool dockDragStarting );
  947.         WBool GetDockDragStarting() const;
  948.  
  949.         // DockWrappable
  950.  
  951.         WBool GetDockWrappable() const;
  952.         WBool SetDockWrappable( WBool wrappable );
  953.  
  954.         // DialogCode
  955.  
  956.         virtual WULong GetDialogCode( WUInt wParam = 0, WLong lParam = 0 );
  957.  
  958.         // DragMode
  959.  
  960.         WDragMode     GetDragMode() const;
  961.         virtual WBool SetDragMode( WDragMode mode );
  962.  
  963.         // DragSourceTag
  964.         //
  965.         //    If not a null/empty string, identifies the window as a
  966.         //    drag source and describes the tag to be used to
  967.         //    fill the structures for DragEvent.
  968.  
  969.         WString GetDragSourceTag() const;
  970.         WBool   SetDragSourceTag( const WString & tag );
  971.  
  972.         // DragTargetTag
  973.         //
  974.         //    If not a null string, identifies the tags that
  975.         //    the window accepts for drag operations. A '*' means all,
  976.         //    a null/empty string means none.
  977.  
  978.         WString GetDragTargetTag() const;
  979.         WBool   SetDragTargetTag( const WString & tag );
  980.     
  981.         // Enabled
  982.  
  983.         virtual WBool SetEnabled( WBool enabled );
  984.         virtual WBool GetEnabled() const;
  985.  
  986.         // ExtendedStyle
  987.  
  988.         WStyle GetExtendedStyle() const;
  989.         WBool  SetExtendedStyle( WStyle style, WBool clone );
  990.         WBool  SetExtendedStyle( WStyle style );
  991.  
  992.         // Focus
  993.  
  994.         WBool SetFocus( WBool focus=TRUE );
  995.         WBool GetFocus() const;
  996.     
  997.         // Font
  998.  
  999.         virtual WBool SetFont( const WFont & font, WBool preserveSize=TRUE );
  1000.         virtual WFont GetFont( WBool getResultingFont=TRUE );
  1001.  
  1002.         // ForeColor
  1003.  
  1004.         virtual WColor GetForeColor( WBool getResultingColor=TRUE ) const;
  1005.         virtual WBool  SetForeColor( const WColor & foreColor );
  1006.  
  1007.         // Handle
  1008.  
  1009.         WWindowHandle GetHandle() const { return _handle; }
  1010.         WBool         SetHandle( WWindowHandle handle );
  1011.  
  1012.         // Height
  1013.  
  1014.         virtual WInt  GetHeight() const;
  1015.         virtual WBool SetHeight( const WInt & height, WBool update=TRUE );
  1016.  
  1017.         // HelpID
  1018.  
  1019.         virtual WULong GetHelpID() const;
  1020.         virtual WBool  SetHelpID( WULong helpID );
  1021.  
  1022.         // HotKey
  1023.  
  1024.         WHotKeyInfo GetHotKey();
  1025.         WBool       SetHotKey( const WHotKeyInfo & hotKey );
  1026.         WBool       SetHotKey( WHotKey *hotKey );
  1027.  
  1028.         // InputContext
  1029.  
  1030.         virtual WInputContext   GetInputContext() const;
  1031.  
  1032.         // InputMode
  1033.  
  1034.         virtual WDWord  GetInputMode() const;
  1035.         virtual WBool   SetInputMode( WDWord mode );
  1036.  
  1037.         // Left
  1038.  
  1039.         virtual WInt  GetLeft() const;
  1040.         virtual WBool SetLeft( const WInt & left, WBool update=TRUE );
  1041.  
  1042.         // Name
  1043.  
  1044.         virtual WString GetName() const;
  1045.         virtual WBool   SetName( const WString & name );
  1046.  
  1047.         // Owner
  1048.  
  1049.         WWindow *GetOwner() const;
  1050.  
  1051.         // Painting
  1052.  
  1053.         virtual WBool GetPainting() const;
  1054.         virtual WBool SetPainting( WBool painting, WBool forceRedraw=TRUE,
  1055.                                    WBool update=FALSE );
  1056.  
  1057.         // Parent
  1058.  
  1059.         virtual WWindow *GetParent() const;
  1060.         virtual WBool    SetParent( const WWindow * parent );
  1061.  
  1062.         // Popup
  1063.  
  1064.         virtual WPopupMenu *GetPopup();
  1065.         virtual WBool       SetPopup( WPopupMenu * popup );
  1066.  
  1067.         // Rectangle
  1068.  
  1069.         virtual WRect GetRectangle( WBool absolute=FALSE ) const;
  1070.         virtual WBool SetRectangle( const WRect & rectangle,
  1071.                                     WBool update=TRUE );
  1072.  
  1073.         // RegisteredClass
  1074.  
  1075.         virtual const WChar *GetRegisteredClass();
  1076.  
  1077.         // Style
  1078.  
  1079.         WStyle GetStyle() const;
  1080.         virtual WBool SetStyle( WStyle style, WBool clone );
  1081.         virtual WBool SetStyle( WStyle style );
  1082.  
  1083.         // Text
  1084.  
  1085.         virtual WString GetText() const;
  1086.         virtual WBool   SetText( const WString & text );
  1087.  
  1088.         // TextLength
  1089.  
  1090.         virtual size_t GetTextLength() const;
  1091.  
  1092.         // ToolTip
  1093.  
  1094.         virtual WToolTip *GetToolTip() const;
  1095.         virtual WBool     SetToolTip( WToolTip * toolTip );
  1096.  
  1097.         // ToolTipText
  1098.  
  1099.         WString       GetToolTipText() const;
  1100.         virtual WBool SetToolTipText( const WString & toolTipText );
  1101.  
  1102.         // Top
  1103.  
  1104.         virtual WInt  GetTop() const;
  1105.         virtual WBool SetTop( const WInt & top, WBool update=TRUE );
  1106.  
  1107.         // Topmost
  1108.  
  1109.         WBool SetTopmost( WBool topmost );
  1110.         WBool GetTopmost() const;
  1111.  
  1112.         // UserData
  1113.  
  1114.         virtual void *GetUserData() const;
  1115.         virtual WBool SetUserData( void * userData );
  1116.  
  1117.         // Valid
  1118.  
  1119.         WBool GetValid();
  1120.  
  1121.         // Visible
  1122.  
  1123.         virtual WBool GetVisible() const;
  1124.         virtual WBool SetVisible( WBool visible );
  1125.  
  1126.         // Width
  1127.  
  1128.         virtual WInt  GetWidth() const;
  1129.         virtual WBool SetWidth( const WInt & width, WBool update=TRUE );
  1130.  
  1131.         // WindowID
  1132.  
  1133.         virtual WUInt GetWindowID() const;
  1134.         virtual WBool SetWindowID( WUInt windowID );
  1135.  
  1136.         // WindowPlacement
  1137.  
  1138.         WWindowPlacement GetWindowPlacement() const;
  1139.         WBool SetWindowPlacement( const WWindowPlacement & windowPlacement,
  1140.                                   WBool restoreToMaximized=FALSE,
  1141.                                   WBool setMinimizedPosition=TRUE );
  1142.  
  1143.         // ZOrder
  1144.  
  1145.         virtual WUInt GetZOrder() const;
  1146.         virtual WBool SetZOrder( WUInt zorder );
  1147.  
  1148.  
  1149.         /**************************************************************
  1150.          * Methods
  1151.          **************************************************************/
  1152.  
  1153.         // AdjustFloatingFormStyle
  1154.  
  1155.         virtual WBool AdjustFloatingFormStyle( WStyle & style,
  1156.                                                WStyle & exStyle );
  1157.  
  1158.         // AttachToWindow
  1159.         //
  1160.         //    Attach the object to an arbitrary window handle, which
  1161.         //    might represent a window created by someone else.  Set
  1162.         //    "destroy" to true if you want the window to be destroyed
  1163.         //    when the object is destroyed.  Set "subclass" to true if
  1164.         //    you want the window handle subclassed (in the Win32 sense)
  1165.         //    and thus see its events.  If the window handle belongs to
  1166.         //    another process set "destroy" and "subclass" to false.
  1167.  
  1168.         virtual WBool AttachToWindow( WWindowHandle handle, WBool destroy,
  1169.                                       WBool subclass=TRUE );
  1170.  
  1171.         // BringToTop
  1172.  
  1173.         virtual WBool BringToTop();
  1174.     
  1175.         // CalculateSize
  1176.  
  1177.         virtual WRect CalculateSize( const WRect & size, WBool adjust );
  1178.  
  1179.         // ChangeStyle
  1180.  
  1181.         WBool ChangeStyle( WStyle style, WBool on, WBool clone );
  1182.         WBool ChangeStyle( WStyle style, WBool on );
  1183.  
  1184.         // ChangeExtendedStyle
  1185.  
  1186.         WBool ChangeExtendedStyle( WStyle style, WBool on, WBool clone );
  1187.         WBool ChangeExtendedStyle( WStyle style, WBool on );
  1188.  
  1189.         // ClipMouse
  1190.  
  1191.         WBool ClipMouse( const WRect & clipRectangle, WBool absolute=FALSE );
  1192.     
  1193.         // Create
  1194.         //
  1195.         //     Create a window.
  1196.  
  1197.         WBool Create( WWindow *parent );
  1198.         WBool Create( WWindow *parent, const WChar *text );
  1199.         WBool Create( WWindow *parent, const WChar *text, void *data );
  1200.         WBool Create( WWindow * parent, const WRect & rectangle,
  1201.                       const WChar * text=NULL, void * data=NULL );
  1202.         WBool Create( WWindow * parent, const WRect & rectangle,
  1203.                       const WChar * text, WStyle style,
  1204.                       WStyle exStyle, void * data=NULL );
  1205.         WBool Create( WWindow * parent, const WResourceID & id,
  1206.                       WModuleHandle module=_ApplicationModule );
  1207.  
  1208.         // CreateToolTip
  1209.  
  1210.         WBool CreateToolTip( WBool rectangleBased=FALSE,
  1211.                              WLong rectangleBasedId=1 );
  1212.  
  1213.         // Destroy
  1214.  
  1215.         virtual WBool Destroy();
  1216.  
  1217.         // DetachFromWindow
  1218.         //
  1219.         //    Detaches the object from the window handle, if any.
  1220.         //    Does not destroy the window, but will undo any subclassing
  1221.         //    that was done with AttachToWindow.
  1222.         
  1223.         virtual WWindowHandle DetachFromWindow();
  1224.  
  1225.         // EnableScrollBar
  1226.  
  1227.         WBool EnableScrollBar( WScrollDir bar, WBool enable=TRUE );
  1228.  
  1229.         // FindDragSource
  1230.         //
  1231.         //     After the user has signalled a drag, call this routine to
  1232.         //     find out if anyone actually wants to start a drag or not.
  1233.         //     Returns NULL if no one does, otherwise returns the object
  1234.         //     whose StartDrag method should be called.  Note that this
  1235.         //     routine may call one or more DragStart events.  The
  1236.         //     structures will be initialized appropriately for passing
  1237.         //     to the StartDrag method.
  1238.  
  1239.         WWindow *FindDragSource( WDragEventData & event, WDragInfo *dragInfo );
  1240.  
  1241.  
  1242.         // InDragScrollInset
  1243.         //
  1244.         //     Returns TRUE if the given point is in the drag scroll
  1245.         //     inset for the window.  Point can be given in client
  1246.         //     or screen coordinates.
  1247.  
  1248.         virtual WBool InDragScrollInset( const WPoint & point,
  1249.                                          WBool absolute ) const;
  1250.  
  1251.         // InitializeClass
  1252.         //
  1253.         //     A virtual function whose task is twofold:
  1254.         //      a) to register the class (once only)
  1255.         //      b) to return the name of the class
  1256.  
  1257.         virtual const WChar *InitializeClass();
  1258.  
  1259.         // Invalidate
  1260.  
  1261.         WBool Invalidate( WBool erase=TRUE );
  1262.         WBool Invalidate( const WRect & rectangle, WBool erase=TRUE );
  1263.         WBool Invalidate( const WRegion & region, WBool erase=TRUE );
  1264.     
  1265.         // InvokeHelp
  1266.         //
  1267.         //     Simulates the user pressing F1 for the window.
  1268.  
  1269.         WBool InvokeHelp() const;
  1270.  
  1271.         // Move
  1272.  
  1273.         virtual WBool Move( const WRect & rectangle, WBool update=TRUE );
  1274.         virtual WBool Move( const WRect & rectangle, WDeferMoveHandle & dwp );
  1275.         virtual WBool Move( const WPoint & point, WBool update=TRUE );
  1276.         virtual WBool Move( const WPoint & point, WDeferMoveHandle & dwp );
  1277.     
  1278.         // PostMessage
  1279.  
  1280.         WLong PostMessage( const WMessage & msg ) const;
  1281.         
  1282.         // PostUserEvent
  1283.         //
  1284.         //     Post a user-defined "event" (a 32-bit value) which
  1285.         //     is to be processed by the target window's "User" event.
  1286.         //     The event is posted to the message queue and thus
  1287.         //     can be used across threads.
  1288.  
  1289.         WBool PostUserEvent( WWindow * postTo, WULong data );
  1290.  
  1291.         // Scroll
  1292.  
  1293.         virtual WBool Scroll( const WPoint & amount, WRect * toScroll=NULL,
  1294.                               WRect * clipRegion=NULL );
  1295.  
  1296.         // SendMessage
  1297.  
  1298.         WLong SendMessage( const WMessage & msg ) const;
  1299.  
  1300.         // StartDrag
  1301.         //
  1302.         //     Used to actually start a dragging operation.  Captures
  1303.         //     mouse input until the given mouse button is released
  1304.         //     or escape is pressed (or the DragContinue event returns
  1305.         //     a cancel).  If no draginfo is provided, default values
  1306.         //     are used.  If targetDragOver is TRUE, the target object
  1307.         //     will get DragEnter/DragOver/DragLeave/DragDrop events.
  1308.         //     If sourceDragOver is TRUE, the source will also get
  1309.         //     these events as if they were being sent to the drag target.
  1310.  
  1311.         WBool StartDrag( WDragEventData & event,
  1312.                          WULong whichButton=WMK_LBUTTON,
  1313.                          WDragInfo *draginfo=NULL,
  1314.                          WBool sourceDragOver=FALSE,
  1315.                          WBool targetDragOver=TRUE );
  1316.         WBool StartDrag( WULong whichButton=WMK_LBUTTON,
  1317.                          WDragInfo *draginfo=NULL,
  1318.                          WBool sourceDragOver=FALSE,
  1319.                          WBool targetDragOver=TRUE );
  1320.  
  1321.         // StartFakeDrag
  1322.         //
  1323.         //     Simulates a dragging operation between two windows.
  1324.         //     Calls DragStart event at the beginning and then
  1325.         //     DragEnd at the end.  In between, calls DragEnter,
  1326.         //     DragOver, DragDrop for either or both the source
  1327.         //     and target windows.  DragContinue, DragFeedback
  1328.         //     DragLeave and DragScroll are never called.
  1329.         
  1330.         WBool StartFakeDrag( WWindow *target, WDragEventData & event,
  1331.                              WULong   whichButton=WMK_LBUTTON,
  1332.                              WDragInfo *draginfo=NULL,
  1333.                              WBool sourceDragOver=FALSE,
  1334.                              WBool targetDragOver=TRUE );
  1335.         WBool StartFakeDrag( WWindow *target,
  1336.                              WULong   whichButton=WMK_LBUTTON,
  1337.                              WDragInfo *draginfo=NULL,
  1338.                              WBool sourceDragOver=FALSE,
  1339.                              WBool targetDragOver=TRUE );
  1340.  
  1341.         // Update
  1342.  
  1343.         virtual WBool Update( WBool force=FALSE );
  1344.     
  1345.         // UnClipMouse
  1346.  
  1347.         WBool UnClipMouse();
  1348.     
  1349.         // Validate
  1350.  
  1351.         WBool Validate();
  1352.         WBool Validate( const WRect & rectangle );
  1353.         WBool Validate( const WRegion & region );
  1354.     
  1355.         /**************************************************************
  1356.          * Item Properties
  1357.          **************************************************************/
  1358.  
  1359.         // ScrollIncrement
  1360.  
  1361.         virtual WLong GetScrollIncrement( WScrollDir bar ) const;
  1362.         virtual WBool SetScrollIncrement( WScrollDir bar, WLong increment );
  1363.  
  1364.         // ScrollPosition
  1365.  
  1366.         virtual WBool SetScrollPosition( WScrollDir bar, WInt pos,
  1367.                                          WBool redraw=TRUE );
  1368.         virtual WInt GetScrollPosition( WScrollDir bar );
  1369.     
  1370.         // ScrollRange
  1371.  
  1372.         virtual WBool SetScrollRange( WScrollDir bar, const WRange & range,
  1373.                                       WBool redraw=TRUE );
  1374.         virtual WRange GetScrollRange( WScrollDir bar ) const;
  1375.  
  1376.         // ScrollStep
  1377.  
  1378.         virtual WLong GetScrollStep( WScrollDir bar ) const;
  1379.         virtual WBool SetScrollStep( WScrollDir bar, WLong step );
  1380.  
  1381.         // ScrollPageSize
  1382.  
  1383.         virtual WBool SetScrollPageSize( WScrollDir bar, const WInt & psize );
  1384.         virtual WInt GetScrollPageSize( WScrollDir bar ) const;
  1385.  
  1386.         /**************************************************************
  1387.          * Static Properties
  1388.          **************************************************************/
  1389.  
  1390.         // ActiveWindow
  1391.         //
  1392.         //    Returns the WWindow that corresponds to the active window
  1393.         //    in the current thread.  Equivalent to calling
  1394.         //    FindWindow( GetActiveWindowHandle() ).
  1395.  
  1396.         static WWindow *GetActiveWindow();
  1397.  
  1398.         // ActiveWindowHandle
  1399.         //
  1400.         //    The window handle of the thread's active window.  When
  1401.         //    setting, the return value is the handle of the window
  1402.         //    that was already active.
  1403.  
  1404.         static WWindowHandle GetActiveWindowHandle();
  1405.         static WWindowHandle SetActiveWindowHandle( WWindowHandle hWnd );
  1406.  
  1407.         // DefaultWindowClassName
  1408.         //
  1409.         //    Sets the name used to register the internal window class
  1410.         //    that the library uses.  Call this before any forms get
  1411.         //    created (such as in the application object's start event).
  1412.         //    This will not change the class name used by dialogs.
  1413.  
  1414.         static WString GetDefaultWindowClassName();
  1415.         static WBool   SetDefaultWindowClassName( const WString & name );
  1416.  
  1417.         // FocusWindow
  1418.         //
  1419.         //    Returns the WWindow that corresponds to the focus window.
  1420.         //    Equivalent to calling FindWindow( GetFocusWindowHandle() ).
  1421.  
  1422.         static WWindow *GetFocusWindow();
  1423.  
  1424.         // FocusWindowHandle
  1425.         //
  1426.         //    The window handle of the thread's focus window.  When
  1427.         //    setting, the return value is the handle of the window
  1428.         //    that already had the focus.
  1429.  
  1430.         static WWindowHandle GetFocusWindowHandle();
  1431.         static WWindowHandle SetFocusWindowHandle( WWindowHandle hWnd );
  1432.  
  1433.         // ForegroundWindowHandle
  1434.         //
  1435.         //    The window handle of the foreground window.
  1436.  
  1437.         static WWindowHandle GetForegroundWindowHandle();
  1438.         static WBool         SetForegroundWindowHandle( WWindowHandle hWnd );
  1439.  
  1440.         // LastActivePopupWindow
  1441.         //
  1442.         //    Returns the handle of the last active popup window
  1443.         //    given an owner window.  If no active popup window,
  1444.         //    returns the owner window.
  1445.  
  1446.         static WWindowHandle GetLastActivePopupWindow( WWindowHandle owner );
  1447.  
  1448.         /**************************************************************
  1449.          * Static Methods
  1450.          **************************************************************/
  1451.  
  1452.         // AcceptsDropFile
  1453.  
  1454.         static WWindowHandle AcceptsDropFile( WWindowHandle handle );
  1455.  
  1456.         // AddWindowProperty
  1457.         //
  1458.         //    Add a named property (an "int" value) to a window handle.
  1459.  
  1460.         static WBool AddWindowProperty( WWindowHandle handle,
  1461.                                         const WChar *name,
  1462.                                         int value );
  1463.  
  1464.         // ActivatePreviousInstance
  1465.         //
  1466.         //    Given a window handle found by calling something
  1467.         //    like FindWindowByName, activate and restore it and
  1468.         //    its active popup and optionally bring it to the foreground.
  1469.  
  1470.         static WBool ActivatePreviousInstance( WWindowHandle hWnd,
  1471.                                                WBool foreground=FALSE );
  1472.  
  1473.         // BeginDeferMove
  1474.  
  1475.         static WDeferMoveHandle BeginDeferMove( WInt numWindows=0 );
  1476.  
  1477.         // BringWindowToTop
  1478.  
  1479.         static WBool BringWindowToTop( WWindowHandle hWnd );
  1480.  
  1481.         // DeleteWindowProperty
  1482.         //
  1483.         //    Remove a window property.
  1484.  
  1485.         static int DeleteWindowProperty( WWindowHandle handle,
  1486.                                          const WChar *name );
  1487.  
  1488.         // DropFile
  1489.  
  1490.         static WBool DropFile( WWindowHandle handle, WArray<WString> files );
  1491.         static WBool DropFile( WWindowHandle handle, WArray<WString> files,
  1492.                                const WPoint & pt, WBool inNonClientArea,
  1493.                                WBool useUnicode );
  1494.  
  1495.         // EndDeferMove
  1496.  
  1497.         static WBool EndDeferMove( WDeferMoveHandle dwp );
  1498.  
  1499.         // FindWindow
  1500.         //
  1501.         //    Return the WWindow pointer that corresponds to a given
  1502.         //    window handle.  Returns NULL if the window does not
  1503.         //    have a corresponding WWindow OR if the window belongs
  1504.         //    to another process or is invalid.
  1505.  
  1506.         static WWindow * FindWindow( WWindowHandle hdl );
  1507.  
  1508.         // FindWindowByName
  1509.         //
  1510.         //    Searches for a window that has a specific window class
  1511.         //    and optionally a title.  Returns a raw window handle
  1512.         //    which you can then use with AttachToWindow to attach to
  1513.         //    a WWindow object.  Under Win32 you can specify optional
  1514.         //    parameters for searching from a specific parent window
  1515.         //    and after a specific child window.  (A null value for
  1516.         //    the parent means search top-level windows.)
  1517.  
  1518.         static WWindowHandle FindWindowByName( const WChar *className,
  1519.                                                const WChar *title=NULL,
  1520.                                                WWindowHandle parent=0,
  1521.                                                WWindowHandle afterChild=0 );
  1522.  
  1523.         // FindWindowProperty
  1524.         //
  1525.         //    Return the value of a window property.
  1526.  
  1527.         static int FindWindowProperty( WWindowHandle handle,
  1528.                                        const WChar *name );
  1529.  
  1530.         // HitText
  1531.  
  1532.         static WHitTestCode HitTest( WWindowHandle handle,
  1533.                                      const WPoint & pt );
  1534.  
  1535.         // IsMaximized
  1536.         //
  1537.         //    Returns TRUE if the given window handle is maximized.
  1538.  
  1539.         static WBool IsMaximized( WWindowHandle handle );
  1540.  
  1541.         // IsMinimized
  1542.         //
  1543.         //    Returns TRUE if the given window handle is minimized.
  1544.  
  1545.         static WBool IsMinimized( WWindowHandle handle );
  1546.  
  1547.         // MapWindowPoint
  1548.  
  1549.         static WBool MapWindowPoint( WWindow * source, WWindow * dest,
  1550.                                      WPoint & pt );
  1551.  
  1552.         // ShowWindow
  1553.  
  1554.         static WBool ShowWindow( WWindowHandle hWnd, WShowWindowFlag flag );
  1555.  
  1556.         /**************************************************************
  1557.          * Message processing
  1558.          **************************************************************/
  1559.         
  1560.         virtual WBool ProcessMessage( const WMessage & msg,
  1561.                                       WLong & returns );
  1562.  
  1563.         virtual WBool DefaultProcess( const WMessage & msg,
  1564.                                       WLong & returns );
  1565.  
  1566.         virtual WBool CallNextWindowProcedure( const WMessage & msg,
  1567.                                                WLong & returns );
  1568.     
  1569.         virtual WBool ProcessCommand( WUInt id, WNotify code, WNotifyInfo info,
  1570.                                       WLong & returns );
  1571.     
  1572.         virtual WBool ProcessNotify( WUInt id, WNotify code, WNotifyInfo info,
  1573.                                      WLong & returns );
  1574.     
  1575.         /**************************************************************
  1576.          * Creation functions
  1577.          **************************************************************/
  1578.  
  1579.     public:
  1580.         virtual void * GetTargetWindowProc() const;
  1581.  
  1582.         virtual WInt GetTargetOffset() const;
  1583.  
  1584.  
  1585.         virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
  1586.                                    void * data=NULL );
  1587.  
  1588.     protected:
  1589.  
  1590.         void GetWindowStyles( WStyle & normal, WStyle & extended ) const;
  1591.  
  1592.         void ResetWindowStyles();
  1593.  
  1594.         virtual void CopyWindowData( WWindowHandle oldWin,
  1595.                                      WWindowHandle newWin );
  1596.  
  1597.         virtual WBool LoadWindow( WWindow * parent,
  1598.                                   const WResourceID & id,
  1599.                                   WModuleHandle module=_ApplicationModule );
  1600.     
  1601.         virtual WBool MakeWindow( WWindow * parent, WUInt id,
  1602.                                   const WChar *className,
  1603.                                   const WChar *title, const WRect & r,
  1604.                                   WStyle wstyle, WStyle exStyle,
  1605.                                   void * data=NULL );
  1606.  
  1607.         virtual WBool DoStartDrag( WDragEventData & event,
  1608.                                    WULong whichButton,
  1609.                                    WDragInfo *draginfo,
  1610.                                    WBool sourceDragOver,
  1611.                                    WBool targetDragOver );
  1612.  
  1613.         virtual WBool DoStartFakeDrag( WWindow *, WDragEventData & event,
  1614.                                    WULong whichButton,
  1615.                                    WDragInfo *draginfo,
  1616.                                    WBool sourceDragOver,
  1617.                                    WBool targetDragOver );
  1618.  
  1619.         virtual void EventNotice( WEventID id, WEventNotice type );
  1620.  
  1621.         WLong FastSendMessage( WUInt msg, WUInt wParam, WLong lParam ) const;
  1622.  
  1623.         WBool CreateInputContext( WWindowHandle winHandle );
  1624.         WBool AssociateInputContext( WWindowHandle winHandle );
  1625.         WBool DestroyInputContext( WWindowHandle winHandle );
  1626.  
  1627.         /**************************************************************
  1628.          * Event handlers
  1629.          **************************************************************/
  1630.         
  1631.     public:
  1632.  
  1633.         WBool DestroyEventHandler( WWindow * window, WEventData * event );
  1634.         WBool CommandEventHandler( WWindow * window,
  1635.                                    WMessageEventData * event );
  1636.         WBool NotifyEventHandler( WWindow * window,
  1637.                                   WMessageEventData * event );
  1638.         WBool InitPopupMenuEventHandler( WWindow * window,
  1639.                                          WMessageEventData * event );
  1640.         WBool PrivateMessageEventHandler( WWindow * window,
  1641.                                           WMessageEventData * event );
  1642.         WBool ControlColorEventHandler( WWindow * window,
  1643.                                         WMessageEventData * event );
  1644.         WBool NeedToolTipTextEventHandler( WWindow * source,
  1645.                                            WToolTipTextEventData * event );
  1646.         WBool MenuSelectEventHandler( WWindow * window,
  1647.                                       WMessageEventData * event );
  1648.         WBool RightButtonDownHandler( WWindow * window,
  1649.                                       WMouseEventData * event );
  1650.         WBool LeftButtonDownHandler( WWindow * window,
  1651.                                      WMouseEventData * event );
  1652.         WBool RightButtonUpHandler( WWindow * window,
  1653.                                     WMouseEventData * event );
  1654.         WBool ContextMenuHandler( WWindow * window,
  1655.                                   WEventData * event );
  1656.         WBool ContextHelpHandler( WWindow * window,
  1657.                                   WHelpEventData * event );
  1658.         WBool DockLeftButtonUpHandler( WWindow * window,
  1659.                                        WMouseEventData * event );
  1660.         WBool DockLeftButtonDownHandler( WWindow * window,
  1661.                                          WMouseEventData * event );
  1662.         WBool DockMouseMoveHandler( WWindow * window,
  1663.                                     WMouseEventData * event );
  1664.         WBool DockKeyDownEventHandler( WWindow * window,
  1665.                                        WKeyPressEventData * event );
  1666.         WBool ScrollEventHandler( WWindow * window,
  1667.                                   WScrollBarEventData * event );
  1668.         WBool DummyEventHandler( WWindow * window,
  1669.                                  WEventData * event );
  1670.  
  1671.         // Default handlers for drag sources...
  1672.  
  1673.         virtual WBool WantsDragMessage( WULong whichButton ) const;
  1674.         virtual WBool FillDragEventData( WDragEventData & event ) const;
  1675.  
  1676.         WBool DragStartHandler( WWindow *window, WDragEventData *event );
  1677.         WBool DragContinueHandler( WWindow *window, WDragEventData *event );
  1678.         WBool DragFeedbackHandler( WWindow *window, WDragEventData *event );
  1679.         WBool DragEndHandler( WWindow *window, WDragEventData *event );
  1680.         WBool DragFillHandler( WWindow *window, WDragEventData *event );
  1681.  
  1682.         WBool DragEnterHandler( WWindow *window, WDragEventData *event );
  1683.         WBool DragOverHandler( WWindow *window, WDragEventData *event );
  1684.         WBool DragLeaveHandler( WWindow *window, WDragEventData *event );
  1685.         WBool DragDropHandler( WWindow *window, WDragEventData *event );
  1686.  
  1687.         /**************************************************************
  1688.          * Other
  1689.          **************************************************************/
  1690.         
  1691.         virtual WBool SetEventHandler( WEventID id, WObject * object,
  1692.                                        WEventHandler handler,
  1693.                                        void * userdata=NULL,
  1694.                                        WInt * index=NULL );
  1695.  
  1696.         int operator==( const WWindow & obj ) const;
  1697.         int operator!=( const WWindow & obj ) const;
  1698.  
  1699.         virtual void SetClassIcon( const WResourceID & id );
  1700.  
  1701.         virtual WBool SelectControlColors( WDeviceHandle handle,
  1702.                                            WBrushHandle * backBrush,
  1703.                                            WBool backOnly,
  1704.                                            WBool setDefaults=TRUE,
  1705.                                            WColor * backColor=NULL,
  1706.                                            WColor * foreColor=NULL,
  1707.                                            WBool queryOnlyMode=FALSE );
  1708.  
  1709.         WCursor SetCursor( const WCursor & cursor, WBool persistent=FALSE );
  1710.     
  1711.         WBool IsVisible();
  1712.     
  1713.         WBool IsEnabled();
  1714.     
  1715.         WBool       SetCurrentPopupMenu( WPopupMenu *popup );
  1716.         WPopupMenu *GetCurrentPopupMenu() const;
  1717.  
  1718.         virtual WBool OnMouseMessage( const WMessage & msg );
  1719.  
  1720.         virtual WBool RelayToTooltip( const WMessage & msg );
  1721.  
  1722.         virtual WUInt AssignWindowID();
  1723.  
  1724.         virtual WBool FilterMessage( WMessage & msg, WBool & eatMessage );
  1725.  
  1726.         virtual void AddControl( WControl * ctrl );
  1727.         virtual void RemoveControl( WControl * ctrl );
  1728.  
  1729.         virtual WBool IgnoreDeleteItem();
  1730.  
  1731.     private:
  1732.  
  1733.         void    CommonInit();
  1734.  
  1735.     public:
  1736.  
  1737.         WBool LocalProcessGetDialogCode( const WMessage & msg,
  1738.                                          WLong & returns );
  1739.         WBool LocalProcessPaint( const WMessage & msg, WLong & returns );
  1740.         WBool LocalProcessNCButton( const WMessage & msg, WLong & returns );
  1741.         WBool LocalProcessButton( const WMessage & msg, WLong & returns );
  1742.         WBool LocalProcessNCHitTest( const WMessage & msg, WLong & returns );
  1743.         WBool LocalProcessDropFiles( const WMessage & msg, WLong & returns );
  1744.         WBool LocalProcessScroll( const WMessage & msg, WLong & returns );
  1745.         WBool LocalProcessInitMenuPopup( const WMessage & msg,
  1746.                                          WLong & returns );
  1747.         WBool LocalProcessMenuSelect( const WMessage & msg, WLong & returns );
  1748.         WBool LocalProcessEnterIdle( const WMessage & msg, WLong & returns );
  1749.         WBool LocalProcessEnterSizeMove( const WMessage & msg,
  1750.                                          WLong & returns );
  1751.         WBool LocalProcessExitSizeMove( const WMessage & msg,
  1752.                                         WLong & returns );
  1753.         WBool LocalProcessEraseBackground( const WMessage & msg,
  1754.                                            WLong & returns );
  1755.         WBool LocalProcessDeleteItem( const WMessage & msg, WLong & returns );
  1756.         WBool LocalProcessMeasureItem( const WMessage & msg,
  1757.                                        WLong & returns );
  1758.         WBool LocalProcessCompareItem( const WMessage & msg,
  1759.                                        WLong & returns );
  1760.         WBool LocalProcessDrawItem( const WMessage & msg, WLong & returns );
  1761.         WBool LocalProcessNCPaint( const WMessage & msg, WLong & returns );
  1762.         WBool LocalProcessEndSession( const WMessage & msg, WLong & returns );
  1763.         WBool LocalProcessQueryEndSession( const WMessage & msg,
  1764.                                            WLong & returns );
  1765.         WBool LocalProcessWindowPosChanging( const WMessage & msg,
  1766.                                              WLong & returns );
  1767.         WBool LocalProcessWindowPosChanged( const WMessage & msg,
  1768.                                             WLong & returns );
  1769.         WBool LocalProcessCtlColor( const WMessage & msg, WLong & returns );
  1770.         WBool LocalProcessShowWindow( const WMessage & msg, WLong & returns );
  1771.         WBool LocalProcessCreate( const WMessage & msg, WLong & returns );
  1772.         WBool LocalProcessDestroy( const WMessage & msg, WLong & returns );
  1773.         WBool LocalProcessSetCursor( const WMessage & msg, WLong & returns );
  1774.         WBool LocalProcessFocus( const WMessage & msg, WLong & returns );
  1775.         WBool LocalProcessActivate( const WMessage & msg, WLong & returns );
  1776.         WBool LocalProcessActivateApplication( const WMessage & msg,
  1777.                                                WLong & returns );
  1778.         WBool LocalProcessSysCommand( const WMessage & msg, WLong & returns );
  1779.         WBool LocalProcessCommand( const WMessage & msg, WLong & returns );
  1780.         WBool LocalProcessQueryNewPalette( const WMessage & msg,
  1781.                                            WLong & returns );
  1782.         WBool LocalProcessPaletteChanged( const WMessage & msg,
  1783.                                           WLong & returns );
  1784.         WBool LocalProcessMove( const WMessage & msg, WLong & returns );
  1785.         WBool LocalProcessSize( const WMessage & msg, WLong & returns );
  1786.         WBool LocalProcessSysKeyDown( const WMessage & msg, WLong & returns );
  1787.         WBool LocalProcessKeyDown( const WMessage & msg, WLong & returns );
  1788.         WBool LocalProcessKeyUp( const WMessage & msg, WLong & returns );
  1789.         WBool LocalProcessChar( const WMessage & msg, WLong & returns );
  1790.         WBool LocalProcessSysDeadChar( const WMessage & msg,
  1791.                                        WLong & returns );
  1792.         WBool LocalProcessSysColorChange( const WMessage & msg,
  1793.                                           WLong & returns );
  1794.         WBool LocalProcessNotify( const WMessage & msg, WLong & returns );
  1795.         WBool LocalProcessContextMenu( const WMessage & msg,
  1796.                                        WLong & returns );
  1797.         WBool LocalProcessHelp( const WMessage & msg, WLong & returns );
  1798.         WBool LocalProcessMultiMedia( const WMessage & msg, WLong & returns );
  1799.         WBool LocalProcessCaptureChanged( const WMessage & msg,
  1800.                                           WLong & returns );
  1801.         WBool LocalProcessDeviceChange( const WMessage & msg,
  1802.                                         WLong & returns );
  1803.         WBool LocalProcessDisplayChange( const WMessage & msg,
  1804.                                          WLong & returns );
  1805.         WBool LocalProcessPower( const WMessage & msg, WLong & returns );
  1806.         WBool LocalProcessSettingChange( const WMessage & msg,
  1807.                                          WLong & returns );
  1808.         WBool LocalProcessUserChanged( const WMessage & msg,
  1809.                                        WLong & returns );
  1810.         WBool LocalProcessInputLangChange( const WMessage & msg,
  1811.                                            WLong & returns );
  1812.         WBool LocalProcessInputLangChangeRequest( const WMessage & msg,
  1813.                                                   WLong & returns );
  1814.         WBool LocalProcessPrint( const WMessage & msg, WLong & returns );
  1815.  
  1816.         /**************************************************************
  1817.          * Data members
  1818.          **************************************************************/
  1819.     
  1820.     protected:
  1821.  
  1822.         class WDragTagData {
  1823.             public:
  1824.                 WDragTagData();
  1825.                 ~WDragTagData();
  1826.  
  1827.                 WString _source;
  1828.                 WString _target;
  1829.         };
  1830.  
  1831.         WVector<WWindow> *              _children;
  1832.         WULong                          _flags;
  1833.         WStyle                          _styles;
  1834.         WStyle                          _exStyles;
  1835.         WWindowHandle                   _handle;
  1836.         WCallbackProc                   _prevWindowProc;
  1837.         WCallbackProc                   _currWindowProc;
  1838.         void *                          _userData;
  1839.         WPopupMenu *                    _currentPopup;
  1840.         WPopupMenu *                    _popupMenu;
  1841.         WFont *                         _textFont;
  1842.         WRect                           _storeRect;
  1843.         WRect                           _storeClientRect;
  1844.         WDragTagData *                  _dragTags;
  1845.         WColor *                        _backColor;
  1846.         WBrush *                        _backBrush;
  1847.         WColor *                        _foreColor;
  1848.         WDWord                          _wwinEventBits;
  1849.         WDWord                          _threadID;
  1850.         WBool                           _fastSend;
  1851.     
  1852.     private:
  1853.  
  1854.         WWindow *                       _parent;
  1855.         WUInt                           _windowID;
  1856.         WToolTip *                      _toolTip;
  1857.         WDragMode                       _dragMode;
  1858.         WBool                           _dockable;
  1859.         WForm *                         _dockedParent;
  1860.         WString *                       _toolTipText;
  1861.         WString *                       _name;
  1862.         WCursorHandle                   _cursorHandle;
  1863.         WLong                           _increment[2];
  1864.         WLong                           _step[2];
  1865.  
  1866.         WDockFloatingForm *             _dockedFrame;
  1867.         WInt                            _dockedOffset;
  1868.         WDockPosition                   _dockPosition;
  1869.         WInt                            _dockedIndex;
  1870.         WBool                           _dockDragging;
  1871.         WBool                           _dockableAtPos[6];
  1872.         WBool                           _dockWrap;
  1873.         WBool                           _dockDragStarting;
  1874.         WULong                          _helpId;
  1875.         WInputContext                   _inputContext;
  1876.         WInputContextHandle             _oldInputContextHandle;
  1877. };
  1878.  
  1879. extern template WVector<WWindow>;
  1880.  
  1881. struct WDropFileEventData : public WEventData {
  1882.     WPoint              dropPoint;      // mouse position
  1883.     WStringArray        fileName;
  1884.     // Note: These two members are technically redundant, but here for
  1885.     // backwards compatibility and ease of use
  1886.     WULong              numFiles;
  1887.     WChar **            fileNames;
  1888. };
  1889.  
  1890. #ifndef _WNO_PRAGMA_PUSH
  1891. #pragma enum pop;
  1892. #pragma pack(pop);
  1893. #endif
  1894.  
  1895. #endif // _WWINDOW_HPP_INCLUDED
  1896.